<?php
// +----------------------------------------------------------------------
// | 随访系统
// +----------------------------------------------------------------------
// | Copyright (c) 2018-2050 http://www.hedesoft.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +---------------------------------------------------------------------
// | Author: 小李子 < 490959289@qq.com>
// +----------------------------------------------------------------------
namespace app\home\controller;
use think\Controller;
use think\Request;
use think\Cache;
use think\Session;
use think\Db;
class Base extends Controller
{
    /*
    *控制器初始化
    *登录状态检查
    *权限检查
    *控制台菜单
    */
    public function _initialize()
    {
        $this->request = $request = Request::instance();
        if ($request->isAjax()==false && empty($admin_login)){

        }elseif ($request->isAjax()==true && empty($admin_login)){

        }

    }

    /**
     * 获取配置信息
     * @access public
     */
    public function getConfig()
    {
        $config=Cache::get('config');
        if(empty($config)){
            $configs = Db::name('Config')->select();
            foreach ($configs as $key=>$value){
                $config[$value['key_name']]=$value['key_value'];
            }
            Cache::set('config',$config);
        }
        return $config;
    }


}
